/*路由*/
import Vue          from "vue"
import VueRouter    from "vue-router";

import Login        from "../pages/Login";
import Home         from "../pages/Home";
import Index        from "../pages/homeIndex"
import Product      from "../pages/homeProduct"
import Detail       from "../pages/homeDetail"

import Cart         from "../pages/Cart";
import Order        from "../pages/Order";
import orderConfirm from "../pages/orderConfirm";
import orderList    from "../pages/orderList";
import orderPay     from "../pages/orderPay";
import aliPay       from "../pages/aliPay";

Vue.use(VueRouter);

export default new VueRouter({
    routes:[
        {
            path:'/',
            name:'home',
            component:Home,
            redirect:'/index',
            children:[
                {
                    path:'/index',
                    name:'index',
                    component:Index,
                },
                {
                    path: '/product/:id',
                    name:'product',
                    component: Product
                },
                {
                    path: '/detail/:id',
                    name:'detail',
                    component: Detail
                },
            ]
        },
        {
            path: '/login',
            name:'login',
            component: Login
        },
        {
            path: '/cart',
            name:'cart',
            component: Cart
        },
        {
            path: '/order',
            name:'order',
            component: Order,
            children:[
                {
                    path: 'list',
                    name:'order-list',
                    component: orderList,
                },
                {
                    path: 'pay',
                    name:'order-pay',
                    component: orderPay,
                },
                {
                    path: 'confirm',
                    name:'order-confirm',
                    component: orderConfirm,
                },
                {
                    path: 'alipay',
                    name:'ali-pay',
                    component: aliPay,
                }

            ]
        }
    ]
})